<template>
  <div>
    <h3>待办列表:</h3>
    <ul>
      <li v-for="item in items" :key="item.id">
        {{ item.name }}
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'TodoList', // 多单词组件名
  props: ['items'] // 接收 items 数据
}
</script>

<style scoped>
ul {
  list-style-type: none;
  padding: 0;
  text-align: left;
  display: inline-block;
}
li {
  color: #42b983;
  margin: 5px 0;
  padding: 8px;
  background-color: #f9f9f9;
  border-radius: 4px;
}
</style>